package com.dbq.fast.common.net.mock.mockApi;

import com.dbq.fast.common.net.mock.MockInterface;
import com.dbq.fast.common.net.mock.MockRouter;

/**
 * Created by sunkai on 2017/10/30.
 */

public class MockPacakge implements MockInterface {
    public static final String URL_GET_SERVICE = MockRouter.BASE_URL + "/getService";

    private static final String getServiceResponse = "{\n" +
            "    \"code\": 200,\n" +
            "    \"data\": {\n" +
            "        \"appServiceList\": [\n" +
            "            {\n" +
            "                \"serviceId\": 1,\n" +
            "                \"colorId\": 1,\n" +
            "                \"serviceName\": \"游戏VIP\",\n" +
            "                \"servicePrice\": \"0.9\",\n" +
            "                \"serviceDesc\": \"15M独享带宽\\\\n游戏稳定15ping\\\\n完美兼容国内主流APP\\\\n支持安卓和IOS\\\\n在任意国家通用\",\n" +
            "                \"serviceRecommend\": 1,\n" +
            "                \"serviceLevel\": 2\n" +
            "            },\n" +
            "            {\n" +
            "                \"serviceId\": 2,\n" +
            "                \"colorId\": 2,\n" +
            "                \"serviceName\": \"视频VIP\",\n" +
            "                \"servicePrice\": \"0.6\",\n" +
            "                \"serviceDesc\": \"2M独享带宽\\\\n完美兼容国内主流视屏APP\\\\n支持安卓和IOS\\\\n在任意国家通用\",\n" +
            "                \"serviceRecommend\": 0,\n" +
            "                \"serviceLevel\": 1\n" +
            "            }\n" +
            "        ]\n" +
            "    },\n" +
            "    \"message\": \"成功\"\n" +
            "}";

    public final static String URL_GET_PACKAGE = MockRouter.BASE_URL + "/getPackage";

    private final static String getPackageResponse = "{\n" +
            "    \"code\": 200,\n" +
            "    \"msg\": \"获取成功\",\n" +
            "    \"data\": {\n" +
            "        \"vpnsetMealList\": [\n" +
            "            {\n" +
            "                \"setMealId\": 1,\n" +
            "                \"setMealOriginalDollarPrice\": \"$50\",\n" +
            "                \"setMealOriginalRmbPrice\": \"￥300\",\n" +
            "                \"setMealDiscount\": 1,\n" +
            "                \"setMealDiscountDollarPrice\": \"$20\",\n" +
            "                \"setMealDiscountRmbPrice\": \"￥120\",\n" +
            "                \"setMealTime\": 1,\n" +
            "                \"setMealDeadLine\": \"2018-08-09\"\n" +
            "            },\n" +
            "            {\n" +
            "                \"setMealMonthId\": 2,\n" +
            "                \"setMealOriginalDollarPrice\": \"$50\",\n" +
            "                \"setMealOriginalRmbPrice\": \"￥300\",\n" +
            "                \"setMealDiscount\": 2,\n" +
            "                \"setMealDiscountDollarPrice\": \"$20\",\n" +
            "                \"setMealDiscountRmbPrice\": \"￥120\",\n" +
            "                \"setMealMonthTime\": 3,\n" +
            "                \"setMealMonthDeadLine\": \"2018-10-09\"\n" +
            "            }\n" +
            "        ],\n" +
            "        \"payPageStyle\": 1\n" +
            "    }\n" +
            "}";

    public static final String URL_BUY_PACKAGE  = MockRouter.BASE_URL+"/buyPackage";

    private static final String buyPackageResponse="  {\n" +
            "                \"code\":200,\n" +
            "                \"msg\":\"支付成功\",\n" +
            "                \"data\":{\n" +
            "                    \"orderId\":\"2017181694\"\n" +
            "                }\n" +
            "            }\n";
    @Override
    public byte[] getResponse(String url) {
        String result = "";
        switch (url) {
            case URL_GET_SERVICE:
                result = getServiceResponse;
                break;
            case URL_GET_PACKAGE:
                result = getPackageResponse;
                break;
            case URL_BUY_PACKAGE:
                result = buyPackageResponse;
                break;
        }
        return result.getBytes();
    }
}
